<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>test</title>
    <script>

        //全国联动
        qg = [
            "全国","北京","上海","天津","重庆","浙江","广东","江苏","福建","辽宁","河北","河南","山东",
            "山西","湖北","安徽","江西","四川","云南","贵州","海南","新疆","湖南","黑龙江"
        ];
        aid = {
            "北京":1,"上海":2,"天津":3,"重庆":4,"香港":5,"澳门":6,"广东":7,"广西":8,"江苏":9,
            "甘肃":10,"宁夏":11,"青海":12,"浙江":13,"山东":14,"黑龙江":15,"河南":16,"河北":17,
            "陕西":18,"辽宁":19,"山西":20,"安徽":21,"福建":22,"云南":23,"海南":24,"内蒙古":25,
            "新疆":26,"湖北":27,"四川":28,"贵州":29,"江西":30,"湖南":31,"吉林":32,"西藏":33,"台湾":34,"全国":35
        };
        sMenu = [
            ["双色球","福彩3D","七乐彩","超级大乐透","七星彩","足彩胜负彩","半全场胜负彩","四场进球彩","排列3","排列5","22选5","36选7"],
            ["北京两步彩","北京快乐8","北京PK拾"],["上海天天彩选4","时时乐","华东六省15选5"],
            ["天津体彩6+1","天津风采15选5"],["重庆时时彩"],["浙江体彩6+1","浙江体彩20选5","华东六省15选5","浙江体彩31选7"],
            ["南粤风采26选5","南粤风采36选7","深圳风采35选7"],["江苏体彩7位数","江苏体彩5+1","华东六省15选5"],
            ["华东六省15选5","福建体彩22选5","福建体彩31选7","福建体彩36选7"],["辽宁风采35选7"],["燕赵风采20选5"],
            ["中原风采22选5"],["齐鲁风采23选5","11选5"],["三晋风采21选5"],["楚天风采22选5"],["华东六省15选5","安徽福彩25选5"],
            ["江西时时彩","华东六省15选5"],["云贵川福彩22选5"],["云贵川福彩22选5"],["云贵川福彩22选5"],
            ["海南体彩4+1"],["新疆风采35选7","新疆风采18选7","新疆风采25选7"],["湖南风采22选5"],
            ["黑龙江体彩6+1","黑龙江福彩P62","龙江风采22选5","龙江风采36选7"]
        ];

        sValue = [
            [51,52,23528,23529,10022,11,16,18,33,35,23525,23527],
            [20104,20108,20109],[10201,10202,21304],[10016,20303],[10401],[10019,21302,21304,23533],
            [20701,20703,20704],[10013,10014,21304],[21304,22204,22205,22206],
            [21902],[21703],[21603],[21401,21406],[22003],[22701],
            [21304,22104],[13001,21304],[23507],[23507],
            [23507],[10026],[22601,22602,22603],[23101],[10010,10025,21502,21504]
        ];

        sss = [["001","002","003","113","110","117","115","116","108","109","23525","23527"],["20104","016","017"],["10201","007","005"],["10016","20303"],["018"],["10019","21302","005","23533"],["20701","20703","20704"],["10013","10014","005"],["005","22204","22205","22206"],["21902"],["21703"],["21603"],["21401","107"],["22003"],["22701"],["005","22104"],["006","005"],["23507"],["23507"],["23507"],["10026"],["22601","22602","22603"],["23101"],["10010","10025","21502","21504"]]

        var lots = {
            "117":{
                "name":"胜负彩",
                "oldId":"11",
                "tradeId":"117",
                "tradeRouter":"/sfc/",
                "isTrade":true,
                "lotteryType":2
            },
            "115":{
                "name":"六场半全场",
                "tradeId":"115",
                "oldId":"16",
                "tradeRouter":"/sfc/bqc/",
                "isTrade":true,
                "lotteryType":2
            },
            "116":{
                "name":"四场进球",
                "tradeId":"116",
                "oldId":"18",
                "tradeRouter":"/sfc/jqc/",
                "isTrade":true,
                "lotteryType":2
            },
            "118":{
                "name":"胜负彩任九",
                "tradeId":"118",
                "oldId":"19",
                "tradeRouter":"/sfc/r9/",
                "isTrade":true,
                "lotteryType":2
            },
            "108":{
                "name":"排列三",
                "tradeId":"108",
                "oldId":"33",
                "tradeRouter":"/lottery/p3/",
                "isTrade":true,
                "lotteryType":1
            },
            "109":{
                "name":"排列五",
                "tradeId":"109",
                "oldId":"35",
                "tradeRouter":"/lottery/p5/",
                "isTrade":true,
                "lotteryType":1
            },
            "001":{
                "name":"双色球",
                "tradeId":"001",
                "oldId":"51",
                "tradeRouter":"/ssq/",
                "isTrade":true,
                "lotteryType":0
            },
            "002":{
                "name":"福彩3D",
                "tradeId":"002",
                "oldId":"52",
                "tradeRouter":"/lottery/3d/",
                "isTrade":true,
                "lotteryType":0
            },
            "110":{
                "name":"七星彩",
                "tradeId":"110",
                "oldId":"10022",
                "tradeRouter":"/lottery/qxc/",
                "isTrade":true,
                "lotteryType":1
            },
            "23508":{
                "name":"双色球红球",
                "lotteryType":0
            },
            "200":{
                "name":"竞彩足球",
                "lotteryType":4
            },
            "23525":{
                "name":"体彩22选5",
                "lotteryType":1
            },
            "23526":{
                "name":"体彩31选7",
                "lotteryType":1
            },
            "23527":{
                "name":"泛珠三角36选7",
                "lotteryType":1
            },
            "003":{
                "name":"七乐彩",
                "tradeId":"003",
                "oldId":"23528",
                "tradeRouter":"/lottery/qlc/",
                "isTrade":true,
                "lotteryType":0
            },
            "113":{
                "name":"超级大乐透",
                "tradeId":"113",
                "oldId":"23529",
                "tradeRouter":"/dlt/",
                "isTrade":true,
                "lotteryType":1
            },
            "23530":{
                "name":"生肖乐",
                "lotteryType":1
            },
            "20104":{
                "name":"北京两步彩（一步区）",
                "lotteryType":0
            },
            "10201":{
                "name":"上海天天彩选4",
                "lotteryType":0
            },
            "007":{
                "name":"上海时时乐",
                "tradeId":"007",
                "oldId":"10202",
                "tradeRouter":"/lottery/ssl/",
                "isTrade":true,
                "lotteryType":0,
                "isGp":true
            },
            "005":{
                "name":"15选5",
                "tradeId":"005",
                "oldId":"21304",
                "tradeRouter":"/lottery/155/",
                "isTrade":true,
                "lotteryType":0
            },
            "10016":{
                "name":"天津体彩6+1",
                "lotteryType":1
            },
            "20303":{
                "name":"天津风采15选5",
                "lotteryType":0
            },
            "10019":{
                "name":"浙江体彩6+1",
                "lotteryType":1
            },
            "21302":{
                "name":"浙江体彩20选5",
                "lotteryType":1
            },
            "23533":{
                "name":"浙江体彩31选7",
                "lotteryType":1
            },
            "20701":{
                "name":"南粤风采26选5",
                "lotteryType":0
            },
            "20703":{
                "name":"南粤风采36选7",
                "lotteryType":0
            },
            "20704":{
                "name":"深圳风采35选7",
                "lotteryType":0
            },
            "10013":{
                "name":"江苏体彩7位数",
                "lotteryType":1
            },
            "10014":{
                "name":"江苏体彩5+1",
                "lotteryType":1
            },
            "020":{
                "name":"山东群英会",
                "tradeId":"020",
                "oldId":"21407",
                "tradeRouter":"/lottery/qyh/",
                "isTrade":true,
                "lotteryType":0,
                "isGp":true
            },
            "22204":{
                "name":"福建体彩22选5",
                "lotteryType":1
            },
            "22205":{
                "name":"福建体彩31选7",
                "lotteryType":1
            },
            "22206":{
                "name":"福建体彩36选7",
                "lotteryType":1
            },
            "21902":{
                "name":"辽宁风采35选7",
                "lotteryType":0
            },
            "21703":{
                "name":"燕赵风采20选5",
                "lotteryType":0
            },
            "21603":{
                "name":"中原风采22选5",
                "lotteryType":0
            },
            "21401":{
                "name":"齐鲁风采23选5",
                "lotteryType":0
            },
            "107":{
                "name":"山东11选5",
                "tradeId":"107",
                "oldId":"21406",
                "tradeRouter":"/lottery/sd115/",
                "isTrade":true,
                "lotteryType":1,
                "isGp":true
            },
            "22003":{
                "name":"三晋风采21选5",
                "lotteryType":0
            },
            "22701":{
                "name":"楚天风采22选5",
                "lotteryType":0
            },
            "10010":{
                "name":"黑龙江体彩6+1",
                "lotteryType":1
            },
            "10025":{
                "name":"黑龙江福彩P62",
                "lotteryType":0
            },
            "21502":{
                "name":"龙江风采22选5",
                "lotteryType":0
            },
            "21504":{
                "name":"龙江风采36选7",
                "lotteryType":0
            },
            "22104":{
                "name":"安徽福彩25选5",
                "lotteryType":0
            },
            "006":{
                "name":"江西时时彩",
                "tradeId":"006",
                "oldId":"13001",
                "tradeRouter":"/lottery/ssc/",
                "isTrade":true,
                "lotteryType":0,
                "isSsc":true,
                "isGp":true
            },
            "23507":{
                "name":"云贵川福彩22选5",
                "lotteryType":0
            },
            "10026":{
                "name":"海南体彩4+1",
                "lotteryType":1
            },
            "22601":{
                "name":"新疆风采35选7",
                "lotteryType":0
            },
            "22602":{
                "name":"新疆风采18选7",
                "lotteryType":0
            },
            "22603":{
                "name":"新疆风采25选7",
                "lotteryType":0
            },
            "004":{
                "name":"东方6+1",
                "tradeId":"004",
                "oldId":"23531",
                "tradeRouter":"/lottery/df/",
                "isTrade":true,
                "lotteryType":0
            },
            "23101":{
                "name":"湖南风采22选5",
                "lotteryType":0
            },
            "018":{
                "name":"重庆时时彩",
                "tradeId":"018",
                "oldId":"10401",
                "tradeRouter":"/cqssc/",
                "isTrade":true,
                "lotteryType":0,
                "isSsc":true,
                "isGp":true
            },
            "016":{
                "name":"快乐8",
                "tradeId":"016",
                "oldId":"20108",
                "tradeRouter":"/lottery/kl8/",
                "isTrade":true,
                "lotteryType":0,
                "isGp":true
            },
            "20105":{
                "name":"北京3D",
                "lotteryType":0
            },
            "21505":{
                "name":"黑龙江时时彩",
                "lotteryType":0,
                "isSsc":true,
                "isGp":true
            },
            "21706":{
                "name":"燕赵风采排列7",
                "lotteryType":0
            },
            "22604":{
                "name":"新疆风采偶数10选7",
                "lotteryType":0}
            ,
            "23006":{
                "name":"江西风采15选5",
                "lotteryType":0
            },
            "23009":{
                "name":"多乐彩",
                "lotteryType":0,
                "isGp":true
            },
            "23534":{
                "name":"北京体彩33选7",
                "lotteryType":0
            },
            "23539":{
                "name":"吉林11选5",
                "lotteryType":0,
                "isGp":true
            },
            "23531":{
                "name":"东方6+1",
                "lotteryType":0
            },
            "21705":{
                "name":"燕赵风采排列5",
                "lotteryType":0
            },
            "017":{
                "name":"PK10",
                "tradeId":"017",
                "oldId":"20109",
                "tradeRouter":"/lottery/pk10/",
                "isTrade":true,
                "lotteryType":0,
                "isGp":true
            },
            "104":{
                "name":"广东11选5",
                "tradeId":"104",
                "oldId":"23544",
                "tradeRouter":"/gd115/",
                "isTrade":true,
                "lotteryType":1,
                "isGp":true
            },
            "106":{
                "name":"多乐彩",
                "tradeId":"106",
                "oldId":"23540",
                "tradeRouter":"/lottery/jx115/",
                "isTrade":true,
                "lotteryType":1,
                "isGp":true
            },
            "024":{
                "name":"安徽快三",
                "tradeId":"024",
                "oldId":"23543",
                "tradeRouter":"/lottery/ahk3/",
                "isTrade":true,
                "lotteryType":1,
                "isGp":true
            },
            "025":{
                "name":"快乐十分",
                "tradeId":"025",
                "oldId":"23545",
                "tradeRouter":"/lottery/kl10/",
                "isTrade":true,
                "lotteryType":1,
                "isGp":true
            }
        }
/*
        for (var i=0; i<sValue.length; i++){
            var val = sValue[i];
            for (var n=0; n<val.length; n++){
                var id = val[n];
                val[n] =  to (lots,id)
            }
        }
        console.log(JSON.stringify(sValue))
        function to (lots,lotid){
            if (lots[lotid]) return lotid+"";
            for (var key in lots){
                var oid = lots[key].oldId;
                if (oid == lotid) return key;

            }

        }

 */
        var o= {};
        for (var i=0; i<qg.length; i++){
            o[qg[i]] = {}
            o[qg[i]].id = aid[qg[i]]
            o[qg[i]].lotIds = sss[i]
        }
        t = JSON.stringify(o);
        console.log(t)



    </script>
</head>
<body>
</div>
</body>
</html>